Presented are the teaching tips from the FMG online teaching survey, conducted by the FMG Teaching & Learning Centre.
---
title: "FMG-TLC online teaching survey report"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
theme: default
css: "style.css"
source_code: embed
# df_print: tibble
---
```{r setup, include=FALSE}
library(flexdashboard)
library("readxl")
survey_results <- read_excel("../../data/FMG teachers 2 minute survey December 2020_January 15, 2021_09.45.xlsx", skip = 1)
```
Column {data-width=300}
-----------------------
Presented are the teaching tips from the FMG online teaching survey, conducted by the FMG Teaching & Learning Centre.
### Responses
```{r}
n.responses <- dim(survey_results)[1]
valueBox(n.responses, icon = "fa-pencil", color = "#E89300")
```
### Teaching tips
```{r}
n.tips <- length(grep("Yes", survey_results$`Would you be willing share this with us in a one-minute video or as part of a TLC newsletter column?`))
valueBox(n.tips, icon = "fa-comments", color = "#E89300")
```
### Schools
```{r}
schools <- survey_results$`In which school(s) do you teach?`
# Some teachers belong to multiple schools
schools <- strsplit(schools, ",")
schools <- unlist(schools)
as.data.frame(table(schools)) -> schools.freq
```
```{r, eval=T}
# install.packages("plotly")
# install.packages("ggplot2")
library(plotly)
ax <- list(
title = "",
zeroline = FALSE,
showline = FALSE,
showticklabels = FALSE,
showgrid = FALSE
)
schools.freq %>%
plot_ly(x = ~schools,
y = ~Freq,
type = "bar",
colors = "viridis",
marker = list(color = "#E89300")
# autoexpand = F
# orientation = "h"
) %>% layout(xaxis = ax,
yaxis = ax,
margin = list(l = 10,
b = 10,
t = 10,
autoexpand = F),
hoverlabel=list(bgcolor="white"))
```
Column {data-width=650}
-----------------------------------------------------------------------
### `r names(survey_results)[6]`
```{r, echo=FALSE, message=FALSE, warning=FALSE}
library(DT)
willing.to.share <- grep("Yes", survey_results$`Would you be willing share this with us in a one-minute video or as part of a TLC newsletter column?`)
DT::datatable(survey_results[willing.to.share,6],
rownames = FALSE,
colnames = "",
options = list(bPaginate = FALSE)
)
# survey_results[willing.to.share,6]
```
Column {data-width=350}
-----------------------------------------------------------------------
### Word cloud
```{r, eval=TRUE}
# Used resource: https://towardsdatascience.com/create-a-word-cloud-with-r-bde3e7422e8a
# Set seed for same wordcloud after recompiling
set.seed(4536)
# install.packages("RColorBrewer")
library(RColorBrewer)
# install.packages("wordcloud2")
library("wordcloud2")
# install.packages("tm")
library(tm)
library("dplyr")
# Create a vector containing only the text
text <- survey_results$`What is one online teaching tip or trick that you would share with fellow teachers?`
docs <- Corpus(VectorSource(text))
# Clean the text
docs <- docs %>%
tm_map(removeNumbers) %>%
tm_map(removePunctuation) %>%
tm_map(stripWhitespace)
docs <- tm_map(docs, content_transformer(tolower))
docs <- tm_map(docs, removeWords, stopwords("english"))
# Create word frequencies
dtm <- TermDocumentMatrix(docs)
matrix <- as.matrix(dtm)
words <- sort(rowSums(matrix),decreasing=TRUE)
df <- data.frame(word = names(words),freq=words)
# Create word cloud
wordcloud2(data=df, size=1, color='random-dark')
```
### Tips categories
```{r}
coded.tips <- read_excel("../../data/TLC_CheckIn.xls")
as.data.frame(table(coded.tips$Q2_tip_coded)) -> coded.tips
# Drop none responses and other
# subset(coded.tips, Var1 != c(-10, -11) )
#
# data.frame(coded.tips[c(-10, -11),]) -> coded.tips
```
```{r}
coded.tips %>%
filter((Var1 != 'None Offered' & Var1 != 'Other')) %>%
arrange(desc(Freq)) -> coded.tips
rownames(coded.tips) <- 1:dim(coded.tips)[1]
# Found no other way to delete the gaps in the plor for the ommited two categories :-(
write.csv2(coded.tips, file = "tips.csv")
# factor(coded.tips$Var1)
coded.tips <- read.csv2("tips.csv")
coded.tips$Var1 <- factor(coded.tips$Var1, levels = unique(coded.tips$Var1)[order(coded.tips$Freq, decreasing = FALSE)])
coded.tips %>%
plot_ly(x = ~Freq,
y = ~Var1,
type = "bar",
colors = "viridis",
marker = list(color = "#E89300")
# orientation = "h"
) %>% layout(xaxis = ax,
yaxis = ax,
margin = list(l = 10,
b = 10,
t = 10,
autoexpand = F),
hoverlabel=list(bgcolor="white"))
```